import requests
import json

class RunMethod():
    def __init__(self):
        pass
    def post_main(self, url, data, headers=None):
        if headers != None:
            res = requests.post(url=url, data=data, headers=headers,verify=False)
        else:
            res = requests.post(url=url, data=data,verify=False)
        return res.text

    def get_main(self, url, data=None, headers=None):
        if headers != None:
            res = requests.get(url=url, data=data, headers=headers,verify=False)
        else:
            res = requests.get(url=url, data=data,verify=False)
        return res.text

    def run_main(self, method, url, data=None, headers=None):
        if method == 'POST':
            res = self.post_main(url, data, headers=headers)
        else:
            res = self.get_main(url, data, headers=headers)
        return res
